import 'package:flutter/material.dart';
import 'package:wanxiang_app/widgets/tabs.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../pages/login/agreement.dart';
import 'account_textField2.dart';
typedef void ClickCallBack(String content);
class MyAgreemnentDialog extends Dialog {
  ClickCallBack callBack;
  final String title ;
  final String msg ;
  final String sureText ;
  final String cancelText ;
  MyAgreemnentDialog({this.title='', this.msg='',this.cancelText='取消',this.sureText='确定',required this.callBack} );

  @override
  Widget build(BuildContext context) {
    return Material(
        //透明层
        type: MaterialType.transparency,
        child: Container(
          alignment: Alignment.center,
          child:    Container(
            alignment: Alignment.center,
              height: 174.h,
              width: 270.w,
              decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(10.r),
                  color: Colors.white
              ),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Text(title==''?'提示':title,style: TextStyle(color: Color(0xFF007BE5),fontSize: 15.sp),),
                  SizedBox(height: 20.h,),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      Text(
                        '请阅读并同意',
                        style: TextStyle(
                            color: Color(0xFF666666), fontSize: 13.sp),
                      ),
                      InkWell(
                          onTap: () {
                            Get.to(()=>AgreementPage(),arguments: '用户协议');
                          },
                          child: Text(
                            '《用户协议》',
                            style: TextStyle(
                                color: Color(0xFF007BE5), fontSize: 13.sp),
                          )),
                      InkWell(
                          onTap: () {
                            Get.to(()=>AgreementPage(),arguments: '隐私协议');
                          },
                          child: Text(
                            '《隐私协议》',
                            style: TextStyle(
                                color: Color(0xFF007BE5), fontSize: 13.sp),
                          )),
                    ],
                  ),
                  SizedBox(height: 20.h,),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      InkWell(
                          onTap: (){
                            callBack('cancel');
                          },
                          child:   Container(
                            padding: EdgeInsets.fromLTRB(10.w, 5.h, 10.w, 5.h),
                            alignment: Alignment.center,
                            decoration: BoxDecoration(
                                color: Color(0xFFCBCBCB),
                                borderRadius: BorderRadius.circular(4.r)
                            ),
                            child: Text(cancelText,style: TextStyle(color: Colors.white,fontSize: 13.sp),),
                          )
                      )
                      ,
                      SizedBox(width: 12.w,),
                      InkWell(
                          onTap: (){
                              callBack('sure');
                          },
                          child:     Container(
                            padding: EdgeInsets.fromLTRB(10.w, 5.h, 10.w, 5.h),
                            alignment: Alignment.center,
                            decoration: BoxDecoration(
                                color: Color(0xFF007BE5),
                                borderRadius: BorderRadius.circular(4.r)
                            ),
                            child: Text(sureText,style: TextStyle(color: Colors.white,fontSize: 13.sp),),
                          )
                      )

                    ],
                  )

                ],
              )
          )
        )

    );
  }
}